﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <link href="/Static/demo.css" rel="stylesheet" type="text/css" />
    <script src="/Static/boot.js" type="text/javascript"></script>
    <link href="/Static/miniui/themes/blue/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="mini-toolbar" style="padding: 2px; border-bottom: 0;">
        <table style="width: 100%;">
            <tr>
                <td style="width: 90%;">
                    <label style="font-family: Verdana;">
                        供应商名称:
                    </label>
                    <input class="mini-textbox" id="txt_KeyValue" />
                    

                    <a class="mini-button" iconcls="icon-search" onclick="searchList()">查询</a> <a class="mini-button"
                                                                                                  iconcls="icon-remove" onclick="clear()">清空条件</a>
                </td>
            </tr>
        </table>
    </div>
    <div class="mini-fit" style="padding: 0px 0px 0px 0px;">
        <div id="datagrid1" class="mini-datagrid" style="width: 100%; height: 93%;" url="/Ajax/AjaxService.aspx?method=GetAliSupplier&sortField=ID&sordOrder=DESC&isActive=Y" onrowdblclick="EditSupplier"
             idfield="ID" sizelist="[5,10,20,50]" pagesize="10">
            <div property="columns">
                <div type="checkcolumn" width="20">
                </div>
                <div type="indexcolumn" width="15">
                </div>
                <div field="SupplierName" width="100" headeralign="center" allowsort="true">
                    供应商名称
                </div>
                <div field="SupplierLevel" width="20" headeralign="center" dateformat="yyyy-MM-dd" allowsort="true">
                    供应商级别
                </div>
                <div field="SupplierContactName" width="50" align="center" headeralign="center">
                    联系人
                </div>
                <div field="SupplierPhone" width="50" allowsort="true">
                    联系电话
                </div>
                <div field="SupplierAddress" width="100" allowsort="true">
                    联系地址
                </div>
                <div field="Remark" width="100" headeralign="center" allowsort="true">
                    备注
                </div>
                <div field="IsActive" width="20" headeralign="center" allowsort="true">
                    是否可用
                </div>
            </div>
        </div>
    </div>
    <div class="mini-toolbar" style="text-align: center; padding-top: 8px; padding-bottom: 8px;"
             borderstyle="border-left:0;border-bottom:0;border-right:0;">
            <a class="mini-button" style="width: 60px;" onclick="onOk()">确定</a> <span style="display: inline-block;
            width: 25px;"></span><a class="mini-button" style="width: 60px;" onclick="onCancel()">
                关闭
            </a>
        </div>
        <script type="text/javascript">
        mini.parse();
        var grid = mini.get("datagrid1");
        grid.sortBy("ID", "DESC");
        grid.load();
        
        function unfixColumns() {
            grid.unFrozenColumns();
        }
        function fixColumns() {
            grid.frozenColumns(0, 1);
        }
        //去空格
        function trimStr(str) {
            return str.replace(/(^\s*)|(\s*$)/g, "");
        }
        //清空条件
        function clear() {
            mini.get("txt_KeyValue").setValue("");
            mini.getbyName("IsActive").setValue("");
        }
        //查询
        function searchList() {
            var keyValue = trimStr(mini.get("txt_KeyValue").getValue());
            var isActive = mini.getbyName("IsActive").getValue();
            grid.load({ keyValue: keyValue, isActive: isActive });
        }
        function reloadData() {
            searchList();
        }
        $("#txt_KeyValue").bind("keydown", function (e) {
            if (e.keyCode == 13) {
                search();
            }
        });
        
        /**获取页面返回值*********************************************************************/
        function GetData() {
            var rows = grid.getSelecteds();
            return rows;
        }
        /**关闭窗口*********************************************************************/
        function CloseWindow(action) {
            if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
            else window.close();
        }
        function onOk() {
            if (grid.getSelecteds().length == 0) {
                alert("未选中任何行");
                return;
            }
            CloseWindow("ok");
        }
        function onCancel() {
            //清空
            CloseWindow("clear");
        }
        </script>
</body>
</html>
